Ensure that our variable checking for >= 0 is signed
authorSteve Langasek <steve.langasek@ubuntu.com>
Sat, 8 May 2021 10:58:01 +0000 (10:58 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Sat, 8 May 2021 10:58:01 +0000 (10:58 +0000)
commitc8f2f9a8a23b73b01523eef7a42ea0910a426ee0
tree000ebe5aeb9b85a88db1cb0960e65b7a53bc7f30
parent13f9fb818445b1edf935411bece29fab4f42c3de
Ensure that our variable checking for >= 0 is signed

Last-Update: 2020-03-17
Bug-Debian: https://bugs.debian.org/954127

The type of v->n is size_t, which is an unsigned type, and we are assigning
v->n - 1 to i and looping while this is >= 0.  If v->n == 0, on some
architectures (armhf) this results in i being set to a positive value
(specifically, UINT32_MAX).

Gbp-Pq: Name ensure-signed-comparison.patch
mag.c